package com.news.controller;

import com.news.common.lang.Result;
import com.news.service.RegisterService;
import com.news.vo.RegisterVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/register")
public class RegisterController {
    @Autowired
    RegisterService registerService;

    @PostMapping
    public Result register(@Validated @RequestBody RegisterVo registerVo){
        return registerService.register(registerVo);
    }
}
